package com.tas.enums;

import com.tas.service.IStrategyService;
import com.tas.service.impl.DirectAsyncService;
import org.noear.solon.Solon;

/**
 * 异步执行策略
 * @author kevin
 */
public enum StrategyEnum {

  //保存到数据库后 异步执行
  DIRECT(DirectAsyncService.class)

  //可能扩展的其他策略
  ;



  StrategyEnum(Class clz){
    this.strategyClz = clz;
  }

  private Class strategyClz;

  public IStrategyService getStrategy(){
    return (IStrategyService) Solon.context().getBean(strategyClz);
  }
}
